package fule.com.playandroidkotlin.ui.presenter

import fule.com.playandroidkotlin.base.BaseListModel
import fule.com.playandroidkotlin.base.BaseObserver
import fule.com.playandroidkotlin.base.BasePresenter
import fule.com.playandroidkotlin.ui.model.NavigationModel
import fule.com.playandroidkotlin.ui.view.NavigationView

/**
 * 导航
 */
class NavigationPresenter(baseView: NavigationView): BasePresenter<NavigationView>(baseView){

    fun navi(){
        addDisposable(apiServer.navi(),object :  BaseObserver<BaseListModel<NavigationModel.DataBean>>(baseView){

            override fun onSuccess(o: BaseListModel<NavigationModel.DataBean>) {
                baseView.onLoadNavi(o.data!!)
            }

            override fun onError(msg: String?) {
                baseView.showError(msg!!)
            }

        })
    }
}